package com.wing.platform.order.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.wing.mybatis.common.BaseEntity;
import com.wing.platform.cabinet.model.entity.StorageInventoryProduct;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

/**
 * 刀具柜系统设置
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("cab_sys_setting")
public class SysSetting extends BaseEntity<SysSetting> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum Type implements IEnum<Integer> {

        /**
         * 入库
         */
        cab(0,"柜子"),
        /**
         * 出库
         */
        app(1,"小程序"),
        /**
         * 柜子启动画面
         *
         */
        startCab(2,"柜子启动画面");
        private int code;
        private String desc;

        Type(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }

        @JsonCreator
        public static SysSetting.Type jsonCreator(String name) {
            if (StringUtils.isNotBlank(name)) {
                for (SysSetting.Type  item : values()) {
                    if (item.name().equals(name.trim())) {
                        return item;
                    }
                }
            }
            return null;
        }
    }

    /**
     * 类型
     */
    private Type type;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 排序
     */
    private Integer sortNumber;

    /**
     * 客服邮箱
     */
    private String email;

    /**
     * 客服电话
     */
    private String mobile;

    /**
     * 客服二维码图片地址
     */
    private String codeUrl;

    /**
     * 广告语
     */
    private String advertName;

    /**
     * 企业编码
     */
    private String enterpriseCode;

    /**
     * 企业id
     */
    private Long enterpriseId;

    /**
     * 企业名称
     */
    @TableField(exist = false)
    private String enterpriseName;
    @TableField(exist = false)
    private String logo;
}
